package cn.snowsoft.iot.module.cps.mqtt;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;

/**
 * Emqx链接地址
 */
@Component
public class EmqxConnect {
    private static String authenticationId = "password_based:built_in_database";
    //apiKey
    public static String apiKey;
    //apiSecret
    public static String apiSecret;
    public static final String INSTALL_URL = "http://192.168.1.249:18083/api/v5/authentication/" + authenticationId + "/users";
    public static final String DELETE_URL = "http://192.168.1.249:18083/api/v5/authentication/" + authenticationId + "/users";
    public static final String INSTALL_RULE = "http://192.168.1.249:18083/api/v5/rules";
    public static final String GET_RULE = "http://192.168.1.249:18083/api/v5/rules";
    public static final String DELETE_RULE_URL = "http://192.168.1.249:18083/api/v5/rules";
    @Value("${mqtt.secretKey.apiKey}")
    public void setApiKey(String apiKey) {
        EmqxConnect.apiKey = apiKey;
    }
    @Value("${mqtt.secretKey.apiSecret}")
    public void setApiSecret(String apiSecret) {
        EmqxConnect.apiSecret = apiSecret;
    }
}
